/**
 * @author wangj881
 * @date 2024-12-04 9:33
 */
public class L206_2 {

    class Solution {
        public ListNode reverseList(ListNode head) {
            ListNode cur = head;
            ListNode per = null;
            ListNode tmp = null;
            while (cur != null) {
                tmp = cur.next;
                cur.next = per;
                per = cur;
                cur = tmp;
            }
            return per;
        }
    }
}
